The getDateTime method returns an instance of Date object representing execution's date/time.
var getDateTime();
The method returns a valid Date object instance.
The following example demonstrates the use of getDateTime() method.
function start()
{
//retrieve account's executions orders
var account = getAccount();
var executions = account.getExecutions();
//loop through all executions
for(var i = 0; i < executions.length, i++)
{
var execution = executions[i];
//check to see how many days ago this execution happened
var difference = Application.getCurrentTime() - execution.getDateTime();
//since difference is in milliseconds, convert to days
difference = Math.round(difference / 1000 / 60 / 60 / 24);
}
//proceed further...
}
Copyright © 2006-2009 ActiveTick LLC